<?php

namespace app\controller;

use app\BaseController;
use app\exception\ApiException;
use app\Request;
use app\service\RoleService;
use app\service\AdminRoleService;

class AdminRoleController extends BaseController
{
    public function create(Request $request)
    {
        validate([
            "role_id" => "require",
        ])->check($request->post());
        $loginUserInfo = $request->getUserInfo();
        $roleId = $request->post("role_id");
        $result = AdminRoleService::getInstance()->createAdminRole($loginUserInfo["id"], $roleId);
        return jsonResponse($result);
    }
}